import Vue from 'vue';
import VueRouter from 'vue-router';

Vue.use(VueRouter);

import Home from '@/pages/Home'
    import HomeJoke from '@/pages/Home/HomeJoke'
import Study from '@/pages/Study'
import Talks from "@/pages/Talks"
import Images from '@/pages/Images'
import About from '@/pages/About'
import Letter from '@/pages/Letter'
import Search from '@/pages/Search'
import Login from '@/pages/Login'
import Register from '@/pages/Register'
import User from '@/pages/User'
import OutLogin from '@/pages/User/OutLogin'
export default new VueRouter({
    routes:[
        {
            path:"/home",
            component:Home,
            children:[
                {
                    path:"joke",
                    component:HomeJoke,
                },
                {
                    path:'',
                    redirect:'/home/joke'
                }
            ]
        },
        {
            path:"/search",
            component:Search
        },
        {
            path:"/study",
            component:Study,
        },
        {
            path:"/talks",
            component:Talks
        },
        {
            path:"/images",
            component:Images
        },
        {
            path:"/about",
            component:About
        },
        {
            path:"/letter",
            component:Letter
        },
        {
            path:"/login",
            component:Login
        },
        {
            path:"/register",
            component:Register
        },
        {
            path:"/user",
            component:User
        },
        {
            path:"/outLogin",
            component:OutLogin
        },
        //重定向，在项目开始的时候让xx定向到首页
        {
            path:'*',
            redirect:'/home'
        },
        
    ]
})